package offer;

/**
 * @author Jonny Long
 * @date 2021/3/16 19:29
 */
public class Solution10 {
    public int numWays(int n) {
        if(n==0){
            return 0;
        }
        if(n==1){
            return 1;
        }
        int a=0,b=1;
        int sum=0;
        for(int i=2;i<=n;i++){
            sum=(b+a)%1000000007;
            a=b;
            b=sum;
        }
        return sum;
    }
}
